<!DOCTYPE html>
<html>
<head>
<meta charset="<?php echo $cfg_soft_lang; ?>">
<title>更新整站</title>
<link rel="stylesheet" href="../static/web/css/bootstrap.min.css">
<link rel="stylesheet" href="../static/web/font/css/font-awesome.min.css">
<link rel="stylesheet" rel="stylesheet" href="../static/web/css/admin.css">
<link rel="stylesheet" href="../static/web/css/daterangepicker.css">
<script src="../static/web/js/jquery.min.js"></script>
<script src="../static/web/js/moment.min.js"></script>
<script src="../static/web/js/daterangepicker.js"></script>
<script>
$(document).ready(function () {
    $('.datepicker').daterangepicker({
        "singleDatePicker": true,
        "autoApply": true,
        "showDropdowns": true,
        "linkedCalendars": false,
        "timePicker": true,
        "timePicker24Hour": true,
        "showCustomRangeLabel": false,
        ranges: {
            '今日': [moment(), moment()],
            '昨日': [moment().subtract(1, 'days'), moment().subtract(1, 'days')],
            '本月': [moment().startOf('month'), moment().startOf('month')],
            '上月': [moment().subtract(1, 'month').startOf('month'), moment().subtract(1, 'month').startOf('month')]
        },
        "locale": {
            format: 'YYYY-MM-DD HH:mm',
            applyLabel: '确定',
            cancelLabel: '取消',
            daysOfWeek: ['日', '一', '二', '三', '四', '五', '六'],
            monthNames: ['一月', '二月', '三月', '四月', '五月', '六月','七月', '八月', '九月', '十月', '十一月', '十二月'],
            firstDay: 1
        }
    }, function (start) {
        $(this).val(start.format("YYYY-MM-DD HH:mm"));
    });
})
</script>
<script>
function SelUp(){
    var ob1 = document.getElementById("uptype1");
    var ob2 = document.getElementById("uptype2");
    var ob3 = document.getElementById("uptype3");
    if(ob1.checked){
        document.getElementById("seltime").style.display = "";
        document.getElementById("selid").style.display = "none";
    } else if(ob2.checked){
        document.getElementById("seltime").style.display = "none";
        document.getElementById("selid").style.display = "";
    } else {
        document.getElementById("seltime").style.display = "none";
        document.getElementById("selid").style.display = "none";
   }
}
</script>
</head>
<body>
    <table width="98%" cellpadding="3" cellspacing="1" align="center" class="table maintable mt-3 mb-3">
        <form name="form1" action="makehtml_all.php" target="stafrm" method="post">
            <input type="hidden" name="action" value="make">
            <tr>
                <td height="26" colspan="2" background="../static/web/img/tbg.gif" style="padding-left:10px">更新整站</td>
            </tr>
            <tr>
                <td width="260" height="26">更新选项：</td>
                <td height="26">
                  <label><input name="uptype" id="uptype1" type="radio" value="time" onClick="SelUp()" checked="checked">&nbsp;指定时间的所有更新</label>
                  <label><input name="uptype" id="uptype2" type="radio" onClick="SelUp()" value="id">&nbsp;指定ID文档的所有更新</label>
                  <label><input name="uptype" id="uptype3" type="radio" onClick="SelUp()" value="mkall">&nbsp;更新所有</label>
                </td>
            </tr>
            <tr id="seltime">
                <td height="26">起始时间：</td>
                <td height="26"><input type="text" name="starttime" id="starttime" value="<?php echo GetDateMk(time()); ?>" class="datepicker" style="width:160px"></td>
            </tr>
            <tr id="selid" style="display:none">
                <td height="26">起始ID：</td>
                <td height="26"><input name="startid" type="text" id="startid" value="0" style="width:60px"></td>
            </tr>
            <tr>
                <td height="26" bgcolor="#F8FCF1" colspan="2" align="center"><button type="submit" name="Submit" class="btn btn-success btn-sm">开始更新</button></td>
            </tr>
        </form>
        <tr>
            <td height="26" colspan="2">
                <table width="100%" class="table table-borderless">
                    <tr>
                        <td width="70%">结果：</td>
                        <td width="30%" align="right">
                            <script language='javascript'>
                            function ResizeDiv(obj, ty) {
                                if (ty == "+") document.all[obj].style.pixelHeight += 50;
                                else if (document.all[obj].style.pixelHeight > 80) document.all[obj].style.pixelHeight = document.all[obj].style.pixelHeight - 50;
                            }
                            </script>
                            <a href="javascript:;" onClick="ResizeDiv('mdv','+');" class="btn btn-success btn-sm">增大</a>
                            <a href="javascript:;" onClick="ResizeDiv('mdv','-');" class="btn btn-success btn-sm">缩小</a>
                        </td>
                    </tr>
                </table>
            </td>
        </tr>
        <tr>
            <td colspan="2" id="mtd">
                <div id="mdv" style="width:100%;height:300px"> 
                    <iframe name="stafrm" frameborder="0" id="stafrm" width="100%" height="360px"></iframe>
                </div>
                <script>
                document.all.mdv.style.pixelHeight = screen.height - 360;
                </script>
            </td>
        </tr>
    </table>
</body>
</html>